package com.ssm.controller;

import com.ssm.model.Delivery;
import com.ssm.service.DeliveryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class DeliveryController {
    @Autowired
    DeliveryService deliveryService;

    @RequestMapping("/sssss")
    public String selectAllDelivery(Model model)
    {
        List<Delivery> res = deliveryService.selectAllDelivery();
        model.addAttribute("deliverise", res);
        return "delivery";
    }

    @RequestMapping("/todeliverymanage")
    public String todeleviermanage(Model model)
    {
        List<Delivery> deliveries = deliveryService.selectAllDelivery();
        model.addAttribute("deliveries", deliveries);
        return "delivery_manage";
    }
}
